###########重定向#################
# from flask import Flask , render_template,request,redirect
# from vowel import search4letters

# app = Flask(__name__)

# @app.route('/')
# def hello()->'302':
#     return redirect('/entry')

# @app.route('/search4',methods=['POST'])
# def do_search()->'html':
#     phrase = request.form['phrase']
#     letters = request.form['letters']
#     title = 'here are your results:'
#     results = str(search4letters(phrase,letters)) 
#     return render_template('results.html',
#         the_title=title,
#         the_results=results,
#         the_phrase=phrase,
#         the_letters=letters)

# @app.route('/entry')
# def entry_page():
#     return render_template('entry.html',the_title='Welcome to search4letters on the web')

# app.run(debug=True)

##################一个函数可以有多个Url ###########

from flask import Flask , render_template,request
from vowel import search4letters

app = Flask(__name__)




@app.route('/search4',methods=['POST'])
def do_search()->'html':
    phrase = request.form['phrase']
    letters = request.form['letters']
    title = 'here are your results:'
    results = str(search4letters(phrase,letters)) 
    return render_template('results.html',
        the_title=title,
        the_results=results,
        the_phrase=phrase,
        the_letters=letters)

@app.route('/')
@app.route('/entry')
def entry_page():
    return render_template('entry.html',the_title='Welcome to search4letters on the web')
if __name__ == "__main__":
    app.run(debug=True)





